# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import webDataRetrievingContants

class WebDataRetrievingSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(WebDataRetrievingSubDirectiveTree, self).__init__(parent)
        self.createWebDataRetrievingTreeNode()

    def createWebDataRetrievingTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "webDataRetrievingOperation"
        self.setText(0,"Web页面数据提取")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, webDataRetrievingContants.WebDataRetrievingConstants.massDataGrabbingDirective, "批量数据抓取")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, webDataRetrievingContants.WebDataRetrievingConstants.webPageScreenshotDirective, "网页截图")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, webDataRetrievingContants.WebDataRetrievingConstants.gettingWebElementInfoDirective, "获取元素信息(Web)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, webDataRetrievingContants.WebDataRetrievingConstants.gettingWebElementPositionDirective, "获取元素位置(Web)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, webDataRetrievingContants.WebDataRetrievingConstants.gettingWebComboBoxOptionDirective, "获取下拉框选项(Web)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, webDataRetrievingContants.WebDataRetrievingConstants.gettingWebPageInfoDirective, "获取网页信息")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, webDataRetrievingContants.WebDataRetrievingConstants.gettingScrollerPositionDirective, "获取滚动条位置")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            webDataRetrievingContants.WebDataRetrievingConstants.gettingWebDialogContentDirective,
                            "提取网页对话框内容")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            webDataRetrievingContants.WebDataRetrievingConstants.gettingAllFilteredCookiesDirective,
                            "获取筛选所有Cookie")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            webDataRetrievingContants.WebDataRetrievingConstants.gettingSpecifiedCookieInfoDirective,
                            "获取指定Cookie信息")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            webDataRetrievingContants.WebDataRetrievingConstants.startingListeningWebRequestDirective,
                            "开始监听网页请求")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            webDataRetrievingContants.WebDataRetrievingConstants.stoppingListeningWebRequestDirective,
                            "停止监听网页请求")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            webDataRetrievingContants.WebDataRetrievingConstants.gettingWebRequestResultDirective,
                            "获取网页请求结果")

